home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
haeberli
/
fonttools
/
fntslide.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
19KB
|
754 lines
/*
* Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* fontslide
* Make text slides.
*
* Paul Haeberli - 1990
*
*/
#include "gl.h"
#include "device.h"
#include "stdio.h"
#include "objfnt.h"
#define SLMIN 0
#define SLMAX 51
#define YOFFSET 5.5
#define MYOFFSET 4.5
#define LISTSIZE 0.7
char *name;
float fgetmousex();
float flerp();
int slideno;
main(argc,argv)
int argc;
char **argv;
{
short val;
int menu;
noborder();
prefposition(0,XMAXSCREEN,0,YMAXSCREEN);
winopen("fontslide");
doublebuffer();
RGBmode();
gconfig();
subpixel(1);
slideno = SLMIN;
drawit();
swapbuffers();
qdevice(LEFTMOUSE);
qdevice(ESCKEY);
qdevice(PAGEUPKEY);
qdevice(PAGEDOWNKEY);
while(1) {
switch(qread(&val)) {
case REDRAW:
drawit();
swapbuffers();
break;
case ESCKEY:
exit(0);
break;
case PAGEUPKEY:
if(!val) {
slideno++;
if(slideno > SLMAX)
slideno = SLMAX;
drawit();
swapbuffers();
}
break;
case PAGEDOWNKEY:
if(!val) {
slideno--;
if(slideno < SLMIN)
slideno = SLMIN;
drawit();
swapbuffers();
}
break;
case LEFTMOUSE:
if(val) {
while(getbutton(LEFTMOUSE)) {
slideno = flerp((float)SLMIN,(float)SLMAX,fgetmousex())+0.5;
drawit();
swapbuffers();
}
}
break;
}
}
}
printem()
{
int i;
for(i=SLMIN; i<=SLMAX; i++) {
slideno = i;
drawit();
swapbuffers();
system("scrsave /tmp/t.bw 0 1279 0 1023 -b");
system("imgexp /tmp/t.bw /tmp/e.bw");
system("invert /tmp/e.bw /tmp/i.bw");
system("izoom /tmp/i.bw /tmp/z.bw 0.5 0.5 -i");
system("tops /tmp/z.bw -b 1 | lp -dkhaki -o-h");
}
}
drawit()
{
reshapeviewport();
ortho2(0.0,10.0,0.0,8.0);
cpack(0x00400000);
clear();
fontname("./slide.mf");
switch(slideno) {
case 0:
fontsetsize(0.7);
fontmoveto(1.0,6.0);
cpack(0x0000ffff);
fontshow("Rendering Goals");
cpack(0x00ffffff);
fontsetsize(0.7);
fontmoveto(1.5,5.0);
fontshow("~ Compatibility");
fontmoveto(1.5,4.0);
fontshow("~ High Quality");
fontmoveto(1.5,3.0);
fontshow("~ Smooth perfm'nce/");
fontmoveto(2.5,2.0);
fontshow(" quality tradeoff");
break;
case 1:
fontsetsize(0.7);
pushmatrix();
translate(0.0,-1.0,0.0);
fontmoveto(1.0,6.5);
cpack(0x0000ffff);
fontshow("Current Architectures");
cpack(0x00ffffff);
fontsetsize(0.7);
fontmoveto(1.5,5.0);
fontshow("~ Polygon Performance");
fontmoveto(1.5,4.0);
fontshow("~ Sampling Quality");
fontmoveto(1.5,3.0);
fontshow("~ Point Sampling");
popmatrix();
break;
case 2:
fontsetsize(0.7);
pushmatrix();
translate(0.0,-1.0,0.0);
fontmoveto(1.0,6.5);
cpack(0x0000ffff);
fontshow("Anti-Aliasing Solutions");
cpack(0x00ffffff);
fontsetsize(0.7);
fontmoveto(1.5,5.0);
fontshow("~ Area Sampling");
fontmoveto(1.5,4.0);
fontshow("~ Multi-Point Sampling");
popmatrix();
break;
case 3:
fontsetsize(0.7);
pushmatrix();
translate(0.0,-1.0,0.0);
fontmoveto(1.0,6.5);
cpack(0x0000ffff);
fontshow("Acc-Buffer Operations");
cpack(0x00ffffff);
fontsetsize(0.7);
fontmoveto(1.5,5.0);
fontshow("~ Clear");
fontmoveto(1.5,4.0);
fontshow("~ Add with weight");
fontmoveto(1.5,3.0);
fontshow("~ Return with scale");
popmatrix();
break;
case 4:
fontsetsize(1.5*0.7);
fontmoveto(5.0,4.0);
cpack(0x00ffffff);
fontcentershow("Motion Blur");
break;
case 5:
fontsetsize(1.5*0.7);
fontmoveto(5.0,4.0);
cpack(0x00ffffff);
fontcentershow("Depth of Field");
break;
case 6:
fontsetsize(1.5*0.7);
fontmoveto(5.0,4.0);
cpack(0x00ffffff);
fontcentershow("Soft Shadows");
break;
case 7:
fontsetsize(1.5*0.7);
fontmoveto(5.0,4.0);
cpack(0x00ffffff);
fontcentershow("Doing it all");
break;
case 8:
fontsetsize(1.5*0.7);
fontmoveto(5.0,4.0);
cpack(0x00ffffff);
fontcentershow("Anti-Aliasing");
break;
case 9:
fontsetsize(0.7);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("The Goal");
cpack(0x00ffffff);
fontsetsize(0.55);
fontmoveto(5.0,YOFFSET);
fontcentershow("To select and manipulate visual");
fontmoveto(5.0,YOFFSET-1.0*0.7);
fontcentershow("information to direct the");
fontmoveto(5.0,YOFFSET-2.0*0.7);
fontcentershow("viewer's attention and control");
fontmoveto(5.0,YOFFSET-3.0*0.7);
fontcentershow("their perception of an image.");
break;
case 10:
fontsetsize(0.7);
fontmoveto(1.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontshow("Brush Stroke Properties");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ Location");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ Color");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ Size");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ Direction");
break;
case 11:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Spice for Images");
cpack(0x00ffffff);
fontsetsize(1.1);
fontmoveto(5.0,3.6);
fontcentershow("Unsharp");
fontmoveto(5.0,2.5);
fontcentershow("Masking");
break;
case 12:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Spice for Images");
cpack(0x00ffffff);
fontsetsize(1.1);
fontmoveto(5.0,3.0);
fontcentershow("Saturation");
break;
case 13:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Spice for Images");
cpack(0x00ffffff);
fontsetsize(1.1);
fontmoveto(5.0,3.0);
fontcentershow("Color Noise");
break;
case 14:
fontsetsize(0.7);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Le But");
cpack(0x00ffffff);
fontsetsize(0.5);
fontmoveto(5.0,YOFFSET);
fontcentershow("Selectionner et manipuler les");
fontmoveto(5.0,YOFFSET-1.0*0.4);
fontcentershow("informations visuelles pour:");
fontmoveto(5.0,4.25-2.0*0.4);
fontcentershow("~diriger l'attention sur un");
fontmoveto(5.0,4.25-3.0*0.4);
fontcentershow("point precis");
fontmoveto(5.0,4.0-4.0*0.4);
fontcentershow("~modifier et controler la");
fontmoveto(5.0,4.0-5.0*0.4);
fontcentershow("perception de l'image.");
break;
case 15:
fontsetsize(0.7);
cpack(0x0000ffff);
fontmoveto(1.5,YOFFSET+1.0);
fontshow("Les proprietes du");
fontmoveto(3.5,4.9);
fontshow("coup de brosse");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(2.5,4.0-0.0*0.7);
fontshow("~ la position");
fontmoveto(2.5,4.0-1.0*0.7);
fontshow("~ la couleur");
fontmoveto(2.5,4.0-2.0*0.7);
fontshow("~ la taille");
fontmoveto(2.5,4.0-3.0*0.7);
fontshow("~ la direction");
break;
case 16:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Du sel pour les images");
cpack(0x00ffffff);
fontsetsize(0.9);
fontmoveto(5.0,3.0);
fontcentershow("Saturation");
break;
#ifdef NOTDEF
case 17:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Du sel pour les images");
cpack(0x00ffffff);
fontsetsize(0.9);
fontmoveto(5.0,3.5);
fontcentershow("Accentuer");
fontmoveto(5.0,2.5);
fontcentershow("les contrastes");
break;
case 18:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Du sel pour les images");
cpack(0x00ffffff);
fontsetsize(0.9);
fontmoveto(5.0,3.5);
fontcentershow("A jouter du bruit");
fontmoveto(5.0,2.5);
fontcentershow("a la couleur");
break;
#endif
case 17:
fontsetsize(0.8);
cpack(0x00ffffff);
fontmoveto(5.0,YOFFSET+0.0);
fontcentershow("Graphics Utility");
fontmoveto(5.0,YOFFSET-1.5);
fontcentershow("Tools and Libraries");
cpack(0x0000d0ff);
fontsetsize(0.6);
fontmoveto(5.0,YOFFSET-3.5);
fontcentershow("Paul Haeberli");
break;
case 18:
fontsetsize(3.0);
fontmoveto(5.0,YOFFSET-1.75);
cpack(0x000000ff);
fontcentershow("GX6");
break;
case 19:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Image Formats");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ SGI format");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ TIFF format");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ D1 Digital Video");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ Others");
break;
case 20:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Image Functions");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ Reading/Writing");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ Auto-trace routines");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ Dithering functions");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ Image zoom");
break;
case 21:
fontsetsize(0.8);
fontmoveto(5.0,YOFFSET+1.0);
cpack(0x0000ffff);
fontcentershow("Image Tools");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ Scope");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ Movie");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ Dithering program");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ Image zoom");
break;
case 22:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET);
fontcentershow("Digital Color");
fontmoveto(5.0,3.5);
fontcentershow("Separation");
break;
case 23:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("Env Map Tools");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ fromfish");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ envreduce");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ envexpand");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ sphereenv");
break;
case 24:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("An Image Database");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ Environment maps");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ Texture maps");
break;
case 25:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("Geometry Format");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ List of quads");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ List of tris");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ List of tmeshes");
break;
case 26:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("Geometry Tools");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ spin");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ totri");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ tomesh");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ subdiv");
fontmoveto(1.5,YOFFSET-4.0*0.8);
fontshow("~ warpgeom");
break;
case 27:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("Font Tools");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ paintfont");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ adjustfont");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ charfill");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ meshfont");
fontmoveto(1.5,YOFFSET-4.0*0.8);
fontshow("~ bevelstring");
fontmoveto(1.5,YOFFSET-5.0*0.8);
fontshow("~ fromtype1");
break;
case 28:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("Misc Stuff");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ Wacom tablet driver");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ vector and matrix lib");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ triangularization lib");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ tri mesh lib");
fontmoveto(1.5,YOFFSET-4.0*0.8);
fontshow("~ rgb to cmyk");
fontmoveto(1.5,YOFFSET-5.0*0.8);
fontshow("~ easy gl lighting");
break;
case 29:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,YOFFSET+1.0);
fontcentershow("More Misc Stuff");
cpack(0x00ffffff);
fontsetsize(LISTSIZE);
fontmoveto(1.5,YOFFSET-0.0*0.8);
fontshow("~ cpprint");
fontmoveto(1.5,YOFFSET-1.0*0.8);
fontshow("~ textmap");
fontmoveto(1.5,YOFFSET-2.0*0.8);
fontshow("~ spinps");
fontmoveto(1.5,YOFFSET-3.0*0.8);
fontshow("~ dynadraw");
fontmoveto(1.5,YOFFSET-4.0*0.8);
fontshow("~ more");
break;
case 30:
fontsetsize(0.8);
cpack(0x00e0e0e0);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Computer Graphics");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Snacks");
fontmoveto(5.0,MYOFFSET-2.0);
fontsetsize(0.8);
cpack(0x0000d0ff);
fontcentershow("Paul Haeberli");
break;
case 31:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("LEEP Projection");
break;
case 32:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Red-Green");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Stereo");
break;
case 33:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Using");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Environment Maps");
break;
case 34:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Fold-Up");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Environment Maps");
break;
case 35:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Painted");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Environment Map");
break;
case 36:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Using a");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Reflective Sphere");
break;
case 37:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("High Quality");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Rendering");
break;
case 38:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("6-Point");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Perspective");
break;
case 39:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Abstract");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Representations");
break;
case 40:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Line Drawings");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("From Geometry");
break;
case 41:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Paint Font");
break;
case 42:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Mesh Warping");
break;
case 43:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Filtered");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Mouse Input");
break;
case 44:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Image");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Enhancement");
break;
case 45:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Encoding");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Messages");
break;
case 46:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Reverse");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Story Boards");
break;
case 47:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Parametric");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Design");
break;
case 48:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Tiny Pix");
break;
case 49:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("X-Ray Views");
break;
case 50:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Synthetic");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Marbled Paper");
break;
case 51:
fontsetsize(0.8);
cpack(0x0000ffff);
fontmoveto(5.0,MYOFFSET+0.0);
fontcentershow("Light");
fontmoveto(5.0,MYOFFSET-1.0);
fontcentershow("Processing");
break;
}
}